def sort(sp):
    f1 = open(sp)
    a = [int(el.strip()) for el in f1.readlines()]
    f1.close()
    
    n = len(a)
    import time 
    start = time.time()
    for i in range(n-1):
        for j in range(n - i - 1):
            if a[j] > a[j + 1]:
                a[j], a[j+1] = a[j+1] , a[j]
    finish = time.time()
    t = round((finish-start)*1000)
    print(sp[:-4:], t , 'milliseconds')
    
sort('m1_sorted.txt')
sort('m2_reverse.txt')
sort('m3_shuffle.txt')                                         
        